<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/5/24
 * Time: 11:12
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\admin\controller;


use app\common\business\Goods as BusObj;
use app\common\lib\Show;
use app\common\lib\Status;
use think\App;
use think\facade\View;

class Goods extends AdminBase
{
    protected ?BusObj $busObj = null;

    public function __construct(App $app)
    {
        $this->busObj = new BusObj();
        parent::__construct($app);
    }

    /**
     * @return string|\think\response\Json
     * @throws \think\Exception
     */
    public function index(){
        if($this->request->isAjax()){
            $lists = $this->busObj->getIndexPage();
            return Show::json_show(Status::Success,"ok",$lists['data'],$lists['total']);
        }
        return View::fetch();
    }

    /**
     * @return string
     */
    public function dialog(){
        return View::fetch();
    }
}